package com.cn.wanxi.thread;

public class MyThreadTest {


    public static void main(String[] args) {
//        MyThread myThread = new MyThread();
//        myThread.name="线程一";
//        myThread.start();
////       start 线程就绪就绪，并不代表执行
////        run 线程开始
//        MyThread myThread1 = new MyThread();
//        myThread1.name="线程二";
//        myThread1.start();
        for (int i = 0; i < 10; i++) {
            MyThread myThread = new MyThread();
//            myThread.name = "线程" + (i + 1);
//            myThread.setName("线程" + (i + 1));
            myThread.start();
        }
//        线程的执行顺序和cup相关：当线程就绪后，
//        每一个线程都会去CPU里面抢占资源，谁先抢到谁先执行
    }
}
